//电脑类：使用USB设备
public class Computer {

    public void Open(){
        System.out.println("打开电脑");
    }
    public void usbDevice(USB usb){
        usb.OpenDevice();
        if(usb instanceof Mouse){
            Mouse mouse = (Mouse) usb;
            mouse.input();
        } else if (usb instanceof Keyboard) {
            Keyboard keyboard = (Keyboard) usb;
            keyboard.input();
        }
        usb.CloseDevice();
    }
    public void Close(){
        System.out.println("关闭电脑");
    }
}
